Optimal. Leaf size=183 \[ -\frac {2 \left (-2 a^2 B+3 a A b-b^2 B\right ) \sqrt {\frac {a+b \cos (c+d x)}{a+b}} F\left (\frac {1}{2} (c+d x)|\frac {2 b}{a+b}\right )}{3 b^2 d \sqrt {a+b \cos (c+d x)}}+\frac {2 (3 A b-2 a B) \sqrt {a+b \cos (c+d x)} E\left (\frac {1}{2} (c+d x)|\frac {2 b}{a+b}\right )}{3 b^2 d \sqrt {\frac {a+b \cos (c+d x)}{a+b}}}+\frac {2 B \sin (c+d x) \sqrt {a+b \cos (c+d x)}}{3 b d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.29, antiderivative size = 183, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 7, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.226, Rules used = {2968, 3023, 2752, 2663, 2661, 2655, 2653} \[ -\frac {2 \left (-2 a^2 B+3 a A b-b^2 B\right ) \sqrt {\frac {a+b \cos (c+d x)}{a+b}} F\left (\frac {1}{2} (c+d x)|\frac {2 b}{a+b}\right )}{3 b^2 d \sqrt {a+b \cos (c+d x)}}+\frac {2 (3 A b-2 a B) \sqrt {a+b \cos (c+d x)} E\left (\frac {1}{2} (c+d x)|\frac {2 b}{a+b}\right )}{3 b^2 d \sqrt {\frac {a+b \cos (c+d x)}{a+b}}}+\frac {2 B \sin (c+d x) \sqrt {a+b \cos (c+d x)}}{3 b d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2653
Rule 2655
Rule 2661
Rule 2663
Rule 2752
Rule 2968
Rule 3023
Rubi steps
\begin {align*} \int \frac {\cos (c+d x) (A+B \cos (c+d x))}{\sqrt {a+b \cos (c+d x)}} \, dx &=\int \frac {A \cos (c+d x)+B \cos ^2(c+d x)}{\sqrt {a+b \cos (c+d x)}} \, dx\\ &=\frac {2 B \sqrt {a+b \cos (c+d x)} \sin (c+d x)}{3 b d}+\frac {2 \int \frac {\frac {b B}{2}+\frac {1}{2} (3 A b-2 a B) \cos (c+d x)}{\sqrt {a+b \cos (c+d x)}} \, dx}{3 b}\\ &=\frac {2 B \sqrt {a+b \cos (c+d x)} \sin (c+d x)}{3 b d}+\frac {(3 A b-2 a B) \int \sqrt {a+b \cos (c+d x)} \, dx}{3 b^2}-\frac {\left (3 a A b-2 a^2 B-b^2 B\right ) \int \frac {1}{\sqrt {a+b \cos (c+d x)}} \, dx}{3 b^2}\\ &=\frac {2 B \sqrt {a+b \cos (c+d x)} \sin (c+d x)}{3 b d}+\frac {\left ((3 A b-2 a B) \sqrt {a+b \cos (c+d x)}\right ) \int \sqrt {\frac {a}{a+b}+\frac {b \cos (c+d x)}{a+b}} \, dx}{3 b^2 \sqrt {\frac {a+b \cos (c+d x)}{a+b}}}-\frac {\left (\left (3 a A b-2 a^2 B-b^2 B\right ) \sqrt {\frac {a+b \cos (c+d x)}{a+b}}\right ) \int \frac {1}{\sqrt {\frac {a}{a+b}+\frac {b \cos (c+d x)}{a+b}}} \, dx}{3 b^2 \sqrt {a+b \cos (c+d x)}}\\ &=\frac {2 (3 A b-2 a B) \sqrt {a+b \cos (c+d x)} E\left (\frac {1}{2} (c+d x)|\frac {2 b}{a+b}\right )}{3 b^2 d \sqrt {\frac {a+b \cos (c+d x)}{a+b}}}-\frac {2 \left (3 a A b-2 a^2 B-b^2 B\right ) \sqrt {\frac {a+b \cos (c+d x)}{a+b}} F\left (\frac {1}{2} (c+d x)|\frac {2 b}{a+b}\right )}{3 b^2 d \sqrt {a+b \cos (c+d x)}}+\frac {2 B \sqrt {a+b \cos (c+d x)} \sin (c+d x)}{3 b d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.69, size = 154, normalized size = 0.84 \[ \frac {2 \left (2 a^2 B-3 a A b+b^2 B\right ) \sqrt {\frac {a+b \cos (c+d x)}{a+b}} F\left (\frac {1}{2} (c+d x)|\frac {2 b}{a+b}\right )-2 (a+b) (2 a B-3 A b) \sqrt {\frac {a+b \cos (c+d x)}{a+b}} E\left (\frac {1}{2} (c+d x)|\frac {2 b}{a+b}\right )+2 b B \sin (c+d x) (a+b \cos (c+d x))}{3 b^2 d \sqrt {a+b \cos (c+d x)}} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [F] time = 0.66, size = 0, normalized size = 0.00 \[ {\rm integral}\left (\frac {B \cos \left (d x + c\right )^{2} + A \cos \left (d x + c\right )}{\sqrt {b \cos \left (d x + c\right ) + a}}, x\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {{\left (B \cos \left (d x + c\right ) + A\right )} \cos \left (d x + c\right )}{\sqrt {b \cos \left (d x + c\right ) + a}}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 1.75, size = 671, normalized size = 3.67 \[ \frac {2 \sqrt {\left (2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b +a -b \right ) \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, \left (-4 B \left (\cos ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b^{2}+3 A a b \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {\frac {2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b +a -b}{a -b}}\, \EllipticF \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {-\frac {2 b}{a -b}}\right )-3 A \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {\frac {2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b +a -b}{a -b}}\, \EllipticE \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {-\frac {2 b}{a -b}}\right ) a b +3 A \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {\frac {2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b +a -b}{a -b}}\, \EllipticE \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {-\frac {2 b}{a -b}}\right ) b^{2}-2 B \left (\cos ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a b +6 B \left (\cos ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b^{2}-2 B \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {\frac {2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b +a -b}{a -b}}\, \EllipticF \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {-\frac {2 b}{a -b}}\right ) a^{2}-B \,b^{2} \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {\frac {2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b +a -b}{a -b}}\, \EllipticF \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {-\frac {2 b}{a -b}}\right )+2 B \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {\frac {2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b +a -b}{a -b}}\, \EllipticE \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {-\frac {2 b}{a -b}}\right ) a^{2}-2 B \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {\frac {2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b +a -b}{a -b}}\, \EllipticE \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {-\frac {2 b}{a -b}}\right ) a b +2 B \cos \left (\frac {d x}{2}+\frac {c}{2}\right ) a b -2 B \cos \left (\frac {d x}{2}+\frac {c}{2}\right ) b^{2}\right )}{3 b^{2} \sqrt {-2 \left (\sin ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b +\left (a +b \right ) \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, \sin \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {-2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b +a +b}\, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {{\left (B \cos \left (d x + c\right ) + A\right )} \cos \left (d x + c\right )}{\sqrt {b \cos \left (d x + c\right ) + a}}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.80, size = 199, normalized size = 1.09 \[ \frac {2\,B\,\sin \left (c+d\,x\right )\,\sqrt {a+b\,\cos \left (c+d\,x\right )}}{3\,b\,d}+\frac {2\,A\,\left (\mathrm {E}\left (\frac {c}{2}+\frac {d\,x}{2}\middle |\frac {2\,b}{a+b}\right )\,\left (a+b\right )-a\,\mathrm {F}\left (\frac {c}{2}+\frac {d\,x}{2}\middle |\frac {2\,b}{a+b}\right )\right )\,\sqrt {\frac {a+b\,\cos \left (c+d\,x\right )}{a+b}}}{b\,d\,\sqrt {a+b\,\cos \left (c+d\,x\right )}}+\frac {2\,B\,\sqrt {\frac {a+b\,\cos \left (c+d\,x\right )}{a+b}}\,\left (\mathrm {F}\left (\frac {c}{2}+\frac {d\,x}{2}\middle |\frac {2\,b}{a+b}\right )\,\left (2\,a^2+b^2\right )-2\,a\,\mathrm {E}\left (\frac {c}{2}+\frac {d\,x}{2}\middle |\frac {2\,b}{a+b}\right )\,\left (a+b\right )\right )}{3\,b^2\,d\,\sqrt {a+b\,\cos \left (c+d\,x\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\left (A + B \cos {\left (c + d x \right )}\right ) \cos {\left (c + d x \right )}}{\sqrt {a + b \cos {\left (c + d x \right )}}}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________